<?php

class Doctrine_Model_Entities_Base {

    function toArray() {
        $result = array();
        $methods = get_class_methods($this);
        foreach ($methods as $method) {
            if ('get' == substr($method, 0, 3)) {
                $result[substr($method, 3)] = $this->$method();
            }
        }
        return $result;
    }

}

?>
